<template>
    <div>
        {{ num }}<br>
        <button @click="ad()">增加数字</button>
    </div>
</template>
<script>
import { mapState } from 'vuex';

export default {
    data() {
        return {
        }
    },
    created() {
    },
    computed: {
        ...mapState(["num"])
    },
    methods: {
        ad() {
            this.$store.dispatch("ad", 1)
        }
    },
}
</script>
<style lang="less" scoped></style>
